<?php

class Listener_Order_Confirmed_Again extends Listener_Base
{
    public function handle($args)
    {
        $self       = new self();
        $self->args = $args;
        //判断队列是否开启,如果开启则把任务推送到队列
        if ($self->queue_status) {
            Queue::in('default', Listener_Order_Confirmed_Again::class, $args);
        } else {
            $self->perform();
        }
    }

    public function perform()
    {
        $order = $this->args;
        St_Log::write('订单支付二次确认验证', array('status' => $order['status']), "event/order_payed/log");
        $res = St_Functions::order_whether_secondary_confirmation($order['ordersn']);
        St_Log::write('订单支付二次确认验证', array('status'  => $order['status'], 'ordersn' => $order['ordersn'], 'result'  => $res), 'event/order_payed/log');
    }
}